﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
       .serachKuang{ width:100%; height:70px; background-color:White; border-bottom:#ccc 1px solid;}
        .serachList{ width:100%; height:auto;}
        .serachitme{ width:10%; height:100px;position: relative; float:left;}
        .searchTag{width: 50px;height: 35px;-webkit-border-radius: 70px;border-radius: 70px;text-align: -webkit-center;text-align: center;padding-top: 16px;position: absolute;top: 15px;left: 50%;margin-left: -25px;    border: #ccc 1px solid; cursor:pointer;}
        .Article{ clear:both; border-top:#ccc 1px solid; width:100%;padding-top: 20px;font-size: 20px; position:relative;}
        .bottom{position: absolute;width: 100px;height: 50px;border: #ccc 1px solid;text-align: center;line-height: 50px;top: 200px;left: 50%;margin-left: -50px;background-color: #F37B0B;color: white;}
        .selectcolor{ background-color: #F37B0B; color:White;}
    </style>

     <script src="../js/ajax-data.js" type="text/javascript"></script>
    <script src="../js/base.js" type="text/javascript"></script>
    <script src="../js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="../js/dialog.js" type="text/javascript"></script>
    <script type="text/javascript">
    var arr = ["#85ACFC", "#FB9F7A", "#FF7C89", "#69CAF4", "#D256FC", "#89D151", "#56B1EA", "#FF82BA", "#FE9D78", "#F15352", "#3BBE80", "#9AE35D", "#5ECE68", "#56B1EA", "#FF7C89", "#D457FD", "#85ACFC", "#FB9F7A", "#FF7C89", "#69CAF4", "#D256FC", "#89D151"];
    var num = 0;
    $(document).ready(function () {
        load(1);
        $("#title").html("标题：  " + decodeURI(getUrlArgStr("title")));

        $(".bottom").click(function () {
            if ($("#hfid").val() == "0") { alert("选择分配的频道"); return; }
          
            ajax.getAjax("/admin/Ajax/Article.ashx?UpdateChanne", "id=" + getUrlArgStr("id") + "&channeid=" + $("#hfid").val(), function (data) {
                if (data.code == "0") {
                    Alert("保存成功");
                    window.location.href = "List.html";
                }
            });
        });

    });
        function load(page) {
            ajax.getAjax("/admin/Ajax/Article.ashx?getchanne", "page_index=" + page, function (data) {
                $(data.item.table).each(function () {
                    num++;
                    var html = "<div class=\"serachitme\"><div class=\"searchTag\"  id=\"" + this.id + "\">" + this.name + "</div></div>";
                    $("#Chanellist").append(html);
                });
                $(".searchTag").click(function () {
                    $(".searchTag").removeClass("selectcolor");
                    $(this).addClass("selectcolor");
                    $("#hfid").val($(this).attr("id"));
                });
            });
        }
    </script>
</head>
<body>
<input type="hidden" id="hfid" value="0" />
    <div>
        <div style="font-size: 25px;" onclick=" window.location.href='list.html'">
            返回
        </div>
        <div id="Chanellist">
            <div>
                选择频道
            </div>
           
        </div>
        <div class="Article">
            文章
            <div style="position: absolute; left: 100px; top: 70px;" id="title">
                
            </div>
            <div class="bottom">
            保存
        </div>
    </div>
</body>
</html>
